home *** CD-ROM | disk | FTP | other *** search
/ Cre@te Online 2000 December / Cre@teOnline CD05.iso / MacSoft / XML ConsoleMax.sea / XML ConsoleMax / Required / swingall.jar / javax / swing / text / DefaultStyledDocument$StyleChangeUndoableEdit.class (.txt) < prev    next >
Encoding:
Java Class File  |  1999-07-15  |  1.1 KB  |  28 lines

  1. package javax.swing.text;
  2.  
  3. import javax.swing.undo.AbstractUndoableEdit;
  4. import javax.swing.undo.CannotRedoException;
  5. import javax.swing.undo.CannotUndoException;
  6.  
  7. class DefaultStyledDocument$StyleChangeUndoableEdit extends AbstractUndoableEdit {
  8.    protected AbstractDocument.AbstractElement element;
  9.    protected Style newStyle;
  10.    protected AttributeSet oldStyle;
  11.  
  12.    public DefaultStyledDocument$StyleChangeUndoableEdit(AbstractDocument.AbstractElement var1, Style var2) {
  13.       this.element = var1;
  14.       this.newStyle = var2;
  15.       this.oldStyle = var1.getResolveParent();
  16.    }
  17.  
  18.    public void redo() throws CannotRedoException {
  19.       super.redo();
  20.       this.element.setResolveParent(this.newStyle);
  21.    }
  22.  
  23.    public void undo() throws CannotUndoException {
  24.       super.undo();
  25.       this.element.setResolveParent(this.oldStyle);
  26.    }
  27. }
  28.